package com.sdx.console.atnm.service;

import com.ibeetl.admin.core.service.BaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.sdx.console.atnm.dao.AtnmStatementDao;
import com.sdx.console.atnm.entity.AtnmStatement;
import com.sdx.console.base.entity.BaseUniv;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 自荐信 Service
 */

@Service
@Transactional
public class AtnmStatementService extends BaseService<AtnmStatement>{

    @Resource
	private AtnmStatementDao atnmStatementDao;

    public PageQuery<AtnmStatement>queryByCondition(PageQuery query){
        PageQuery ret =  atnmStatementDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelAtnmStatement(List<String> ids){
        try {
            atnmStatementDao.batchDelAtnmStatementByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除自荐信失败", e);
        }
    }

	public List<AtnmStatement> all() {
		return atnmStatementDao.all();
		}

	public List<BaseUniv> selectUnivs() {
    	return atnmStatementDao.selectUnivs();
	}
}